# This file is part of the Spring engine (GPL v2 or later), see LICENSE.html

# - Find Kindlegen
# Find the native Kindlegen binary
#
#  KINDLEGEN_BIN      - will be set to the Kindlegen executable (eg. kindlegen.exe)
#  KINDLEGEN_FOUND    - TRUE if Kindlegen was found

Include(FindPackageHandleStandardArgs)

If(KINDLEGEN_BIN)
  # Already in cache, be silent
  Set(KINDLEGEN_FIND_QUIETLY TRUE)
EndIf (KINDLEGEN_BIN)

find_program(KINDLEGEN_BIN
    NAMES kindlegen
    HINTS "${MINGWDIR}" "${CMAKE_SOURCE_DIR}/installer"
    PATH_SUFFIXES bin
    DOC "Kindlegen executable"
  )

# handle the QUIETLY and REQUIRED arguments and set KINDLEGEN_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(kindlegen DEFAULT_MSG KINDLEGEN_BIN)
